
 
 
<!DOCTYPE html>
<html>
{include file="public/head"}
<body>

{include file="public/nav"}

{include file="community/nav"}
<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8" >


            <div class="fly-panel"> 
                <div class="fly-panel-title fly-filter"> 
                    <a>我的图片</a> 
                    <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a> 
                </div> 
                <ul class="fly-list photos nyoj-my-pic" id="pic-list">
                    
                    {foreach $list as $v}
                    <div class="nyoj-pic-list-item">
                        <img lay-src="__STATIC__/../upload/image/{$v.url}" />
                        <a class="layui-btn layui-btn-sm layui-btn-primary del-img" imgid="{$v.id}">删除</a>
                    </div>
                    
                    {/foreach}
                    
                </ul>        
                <div style="text-align: center;">{$list->render()}</div>

            </div> 
        </div>
        {include file="public/side-bar"}
    </div>
</div>
 {include file="public/foot"}
</body>
<script>
    layui.use(['jquery','flow','layer'],function(){
        var $=layui.jquery;
        var flow=layui.flow;
        var layer=layui.layer;
        flow.lazyimg();
        $('.del-img').click(function(){
            var id=$(this).attr('imgid');
            //console.log(id);
            layer.confirm('真的要删掉吗? ( >﹏<。)～呜呜呜……',{
                 btn: ['确认','取消'] //按钮
            },function(){
                
                
                $.get('/api/del-img-'+id,function(res){
                    if(res.code===0){
                        layer.msg(res.msg);
                        setTimeout('location.reload();',1000);
                        //$(this).parent.remove();
                    }else {
                        layer.msg(res.msg);
                    }
                });
            }); 
        });
    });
</script>
</html>